<template>
	<div>
		<Header title="会员列表"></Header>
		<div class="Order">
			<operate
				:isAddShow="isAddShow"
				:isSeniorShow="isSeniorShow"
			></operate>
			<table cellspacing="0">
				<tr>
					<th><input type="checkbox" /></th>
					<th>会员卡号</th>
					<th>发卡门店</th>
					<th>手机号码</th>
					<th>可用积分</th>
					<th>储值账户余额</th>
					<th>累计消费金额</th>
					<th>累计消费次数</th>
					<th>---</th>
				</tr>
				<tr v-for="item in viewData" :key="item._id">
					<td><input type="checkbox" /></td>
					<td>{{ item.cardNumber }}</td>
					<td>{{ item.stores }}</td>
					<td>{{ item.phoneNumber }}</td>
					<td>{{ item.availableIntegral }}</td>
					<td>{{ item.balance }}</td>
					<td>{{ item.amount }}</td>
					<td>{{ item.numberOfConsumption }}</td>
					<td>
						<span>
							详情
						</span>
					</td>
				</tr>
				<tr>
					<td colspan="9" style="border:0;color:#000">
						<Footer></Footer>
					</td>
				</tr>
			</table>
		</div>
	</div>
</template>
<script>
import Header from "@/components/member/header"
import Footer from "@/components/member/footer"
import operate from "@/components/member/operate"
export default {
	data() {
		return {
			isAddShow: true,
			isSeniorShow: true,
			listData: [],
			totalNums: 0,
			totalPages: 0,
			viewData: [],
			url: "/gxjy/memberList",
		}
	},
	methods: {
		getData() {
			this.$http.get(this.url + "/all").then(ret => {
				console.log(ret)
				// 全部数据
				this.listData = ret.data
				// 总数据条数
				this.totalNums = this.listData.length
				// 总页数
				this.totalPages = Math.ceil(this.totalNums / 10)
				// 可见的数据
				this.viewData = this.listData.splice(
					(this.pageNum - 1) * 10,
					10
				)

			this.$store.commit("common/setTotalNums",this.totalNums);
            this.$store.commit("common/setTotalPages",this.totalPages);
			})
		},
	},
	filters: {},
	beforeDestroy() {},
	created() {
		this.getData()
	},
	components: {
		Footer,
		Header,
		operate,
	},
}
</script>
<style lang="scss" scoped>
@import "@/assets/scss/table.scss";
</style>
